package com.cardbaobao.cardbabyclient.ui.activity;

import android.os.Bundle;
import android.view.View;

import com.cardbaobao.cardbabyclient.R;
import com.cardbaobao.cardbabyclient.buried.Google;
import com.cardbaobao.cardbabyclient.buried.Self;
import com.cardbaobao.cardbabyclient.ui.activity.base.BaseActivity;
import com.cardbaobao.cardbabyclient.buried.GoogleAnalyticsUtil;
import com.cardbaobao.cardbabyclient.widget.TitleBar;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by Jiangzx on 9:29.
 * 社保、公积金、学历查询账号填写成功提交到服务器后展示的页面
 */

public class InquiriesSuccessActivity extends BaseActivity {
    @BindView(R.id.title_bar)
    TitleBar titleBar;

    private String channelType;

    @Override
    protected void onResume() {
        super.onResume();
        if (InquiriesActivity.CHANNEL_GJJ.equals(channelType)) {
            GoogleAnalyticsUtil.setScreenName(Google.ACCUM_FUND_QUERY_NO_DATA);
        } else {
            GoogleAnalyticsUtil.setScreenName(Google.SOCIAL_QUERY_NO_DATA);
        }

    }

    @Override
    protected void initView(Bundle savedInstanceState) {
        super.initView(savedInstanceState);
        titleBar.setLeftViewOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        channelType = getIntent().getStringExtra(InquiriesActivity.CHANNEL_TYPE_S);
        if (InquiriesActivity.CHANNEL_GJJ.equals(channelType)) {
            mCurrentPageId= Self.Page.app_provident_fund_inquiring_page;
            titleBar.setTitleText("公积金查询");
        } else {
            mCurrentPageId=Self.Page.app_social_security_inquiring_page;
            titleBar.setTitleText("社保查询");
        }
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_inquries_success;
    }

    @OnClick(R.id.bt_navigator_index)
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.bt_navigator_index:
                //回到首页
                initIntent();
                mIntent.setClass(mContext, MainActivity.class);
                startActivity(mIntent);
                break;
        }
    }
}
